package com.alibaba.druid.sql.dialect.mysql.ast.expr;

import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.SQLExprImpl;
import com.alibaba.druid.sql.ast.SQLObject;
import com.alibaba.druid.sql.ast.SQLOrderingSpecification;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
















public class MySqlSelectGroupByExpr
        extends SQLExprImpl
        implements MySqlExpr
{
    protected SQLExpr expr;
    protected SQLOrderingSpecification type;

    protected void accept0(SQLASTVisitor visitor) { acceptChild(visitor, (SQLObject)this.expr); }



    public SQLExpr getExpr() { return this.expr; }


    public void setExpr(SQLExpr expr) {
        expr.setParent((SQLObject)this);
        this.expr = expr;
    }


    public SQLOrderingSpecification getType() { return this.type; }



    public void setType(SQLOrderingSpecification type) { this.type = type; }



    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        MySqlSelectGroupByExpr other = (MySqlSelectGroupByExpr)obj;
        if (this.expr != other.expr) {
            return false;
        }
        if (this.type == null) {
            if (other.type != null) {
                return false;
            }
        } else if (!this.type.equals(other.type)) {
            return false;
        }
        return true;
    }


    public int hashCode() {
        int prime = 31;
        int result = 1;
        result = 31 * result + ((this.expr == null) ? 0 : this.expr.hashCode());
        result = 31 * result + ((this.type == null) ? 0 : this.type.hashCode());
        return result;
    }
}
